﻿using System.Collections.Generic;
using System.Data;

namespace DatabaseService
{
    public interface IDatabaseService
    {
        IDatabaseInfoDAO databaseInfoDAO { get; set; }

        #region 基础sql操作
        /// <summary>
        /// 查询操作
        /// </summary>
        /// <param name="commandText"></param>
        /// <returns></returns>
        DataTable Select(string commandText, IDictionary<string,object> parameters = null);
        /// <summary>
        /// 增删改
        /// </summary>
        /// <param name="commandText"></param>
        /// <param name="parameters"></param>
        /// <returns></returns>
        int ExecuteNonQuery(string commandText, IDictionary<string, object> parameters = null);
        #endregion

        #region 存储过程执行
        DataSet ExecuteProcSql(string commandText, IDictionary<string, object> parameters = null);
        DataSet ExecuteProcGetDataSet(string storedProcedureName, IDictionary<string, object> parameters = null);
        void ExecuteProcNonQuery(string storedProcedureName, IDictionary<string, object> parameters = null);
        #endregion
    }
}
